function runanalysis(merged_fm,allvarscalculated,qtrdummy,programFiles,ff_fact)
runalternatedeputil(merged_fm,allvarscalculated,qtrdummy,programFiles,ff_fact);

if ~isempty(ff_fact)
    runboombust(merged_fm,allvarscalculated,qtrdummy,programFiles,ff_fact);
else
    disp('Stopping: download FF factors to run this part to generate Table 6, panel B and C')
end


%=======================================================================
function runalternatedeputil(merged_fm,allvarscalculated,qtrdummy,programFiles,ff_fact)

merged_fm.high_slope = merged_fm.high_slope_level;
runfamamacbethreturns_quarterlyreturns_slope(merged_fm,programFiles,strcat('tnic_beme_',date,'_',num2str(1),'_',num2str(1),'high_slope_lev_d.xlsx'),qtrdummy,allvarscalculated);

function runboombust(merged_fm,allvarscalculated,qtrdummy,programFiles,ff_fact)
%boom bust
runfamamacbethreturns_quarterlyreturns_boom_bust(merged_fm,programFiles,strcat('tnic_beme_',date,'_',num2str(1),'_',num2str(1),'ful_boom.xlsx'),qtrdummy,ff_fact,1)


